package com.yjs.app.trade.service.service.business.storage.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yjs.app.trade.service.service.business.storage.AppOutStorageInfoService;
import com.yjs.base.security.bean.UserContextManager;
import com.yjs.business.ecps.order.model.OrderDetail;
import com.yjs.business.ecps.order.service.IOutStorageInfoService;
import com.yjs.core.common.OperationResult;

@Service("appOutStorageInfoService")
public class AppOutStorageInfoServiceImpl implements AppOutStorageInfoService  {

	@Autowired
	IOutStorageInfoService iOutStorageInfoService;
	
	@Autowired
	UserContextManager userContextManager;
	
	
	@Override
	public OperationResult submitTakeGoods(List<OrderDetail> list,String token) {
		String retoken = token.replace("org.user.context.", "");
		userContextManager.set(retoken);
		OperationResult result = null;
		try {
			result = iOutStorageInfoService.submitTakeGoods_new(list);
		} catch (Exception e) {
			result = new OperationResult();
			result.setResultCode(2);
			result.setResultMessage(e.getMessage());
			return result;
		}
		return result;
	}
}
